<template>
  <div class="centers">
    <div class="right">
      <el-button :icon="MoreFilled" size="small" @click="isCollapseMen" />
      <!-- 面包屑 -->
      <span class="show">首页</span>
    </div>
    <div class="left">
      <el-dropdown>
        <img class="img" src="../assets/imges/Yafeis.png" alt="" />
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item>个人中心</el-dropdown-item>
            <el-dropdown-item>资料修改</el-dropdown-item>
            <el-dropdown-item divided>退出登录</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </div>
  </div>
</template>

<script setup>
import { MoreFilled } from "@element-plus/icons-vue"
import store from "../store";
// import { inject } from "vue"
// const isCollapse = inject("isCollapse")

const isCollapseMen = () => {
  // 这个commit函数是vuex固定提交
  store.commit('increment')
  console.log(store.state.isCollapse)
}
</script>

<style>
.el-header {
  padding: 0;
}
.centers {
  padding: 0 10px;
  height: 45px;
  background-color: rgba(126, 126, 126, 0.727);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.show {
  color: aliceblue;
  margin: 0 5px;
}
img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
}
</style>